/**
 * @see https://leetcode-cn.com/problems/three-consecutive-odds/
 * @param {number[]} arr
 * @return {boolean}
 */
var threeConsecutiveOdds = function (arr) {
  let codes = [];
  for (let i = 0; i < arr.length; i++) {
    const element = arr[i];
    if(element % 2 !== 0) {
      codes.push(element);
      if(codes.length === 3) {
        break;
      }
    } else {
      codes = [];
    }
  }
  console.log(codes)
};

threeConsecutiveOdds([1,2,34,3,4,5,7,23,12]);